//----导出组件
export { registTaskComponents, registeredTaskComponents } from "./taskcoms";

// 导出Grpc Type.
export {
  type ProtobufAny,
  Int32Any,
  Int64Any,
  BoolAny,
  StringAny,
} from "./util/protobuf";

export type {
  FlowTaskModel,
  FlowTaskDefModel,
  FlowGobackTaskRequest,
} from "./api/flow/task/types";
export { type TaskDealWith } from "./api/flow/types";

import type { App } from "vue";

//添加组件.
import { addViteMenus, i18n, addDynamicRoute } from "jmash-core";

// 本地语言包
import { loadLang } from "./lang";

const modules = import.meta.glob("./views/**/**.vue");
// 导出API
export { taskApi } from "./api/flow/task/index";
export { commentApi } from "./api/flow/comment/index";
export type { FlowHiCommentModel } from "./api/flow/comment/types";
export type { FlowCompleteTaskRequest } from "./api/flow/task/types";

//本地动态路由
import flowRoutes from "./router/flowrouter";

//组件
const HolidayRequestTask = () =>
  import("./components/HolidayRequestTask/index.vue");

const FormDynamicCreate = () =>
  import("./components/FormDynamicCreate/index.vue");
import { registTaskComponents } from "./taskcoms";

// 全局注册Jmash-dict插件.
const flow = {
  install(app: App) {
    addViteMenus(modules, 7);
    loadLang(i18n);
    addDynamicRoute(flowRoutes);
    //注册任务动态组件.
    registTaskComponents("HolidayRequestTask", HolidayRequestTask);
    registTaskComponents("FormDynamicCreate", FormDynamicCreate);
  },
};

export default flow;
